package com.msw.axon.service;

import com.msw.axon.dao.UserDao;
import com.msw.axon.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * × TODO 一句话描述类的含义
 * Created by hadoop on 16-1-14.
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    @Transactional
    public void addUser(String name)
    {
        userDao.save(new User(name));
    }

    public List<User> queryByName(String name)
    {
        return userDao.queryByName(name);
    }

}
